﻿using System;

namespace Sissonix.ExtRest.Serialization
{
    /// <summary>
    /// Interface that all serializers must implement.
    /// </summary>
    public interface ISerializer
    {
        /// <summary>
        /// Gets the content type.
        /// </summary>
        /// <value>The content type.</value>
        string ContentType { get; }

        /// <summary>
        /// Deserializes the specified value.
        /// </summary>
        /// <param name="value">The value to deserialize.</param>
        /// <param name="type">The type to deserialize to.</param>
        /// <returns></returns>
        object Deserialize(string value, Type type);

        /// <summary>
        /// Serializes the specified object.
        /// </summary>
        /// <param name="objectToSerialize">The object to serialize.</param>
        /// <returns></returns>
        string Serialize(object objectToSerialize);
    }
}
